import urllib.request
from urllib.request import urlopen

if __name__ == "__main__":
    myURL = urlopen("https://www.w3cschool.cn/")
    # print(myURL.read())
    print(myURL.getcode())

    f = open("w3cschool_urllib_test.html", "wb")
    content = myURL.read()
    f.write(content)
    f.close()